﻿@page
@model KentNoteBook.WebApp.Pages.Shared.TopModel
@{
	Layout = null;
}

<a class="navbar-brand" href="#">Admin System V1.0</a>
<button class="navbar-toggler border text-white" type="button" id="btnToggleSidebar">
	<i class="fa fa-bars"></i>
</button>
<div class="btn-group ml-auto profile-setting">
	<a class="nav-link btn btn-secondary dropdown-toggle bg-transparent border-0" href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
		<i class="fa fa-user"></i> @this.User.Identity.Name <b class="caret"></b>
	</a>
	<div class="dropdown-menu dropdown-menu-right">
		<a class="dropdown-item" href="#" data-toggle="modal" data-target="#modal_dialog_layout" data-modal-title="Edit Profile" data-modal-url="/Home/Profile" data-modal-size="lg"><i class="fa fa-fw fa-user"></i> Profile </a>
		@*<a class="dropdown-item" href="javascript:void(0)"><i class="fa fa-fw fa-envelope"></i> Inbox </a>
			<a class="dropdown-item" href="javascript:void(0)"><i class="fa fa-fw fa-gear"></i> Settings </a>*@
		<a id="btnLogoutOnTop" class="dropdown-item" ajax-link="true" href="#" data-url="/login?_=@DateTime.Now.Millisecond" data-update-panel="app-root"><i class="fa fa-fw fa-power-off"></i> Log Out </a>

	</div>
	@*<a id="btnLogoutOnTop" class="btn btn-secondary bg-transparent border-0" href="#"><i class="fa fa-fw fa-power-off"></i> Log Out </a>*@
</div>

<script type="text/javascript">
	// remove the access token while logout
	$("#btnLogoutOnTop").click(function (e) {
		e.preventDefault();

		localStorage.removeItem("access_token");
		localStorage.removeItem("expires_at");

		location.href = "/Login";
	});
</script>